const db = require("../../module/db/db.js")
const axios = require("../../lib/params.js")
const jsonParse = require('../../lib/jsonParse.js')

const test = db.getSchema("test") // 手机

module.exports = {
    async getTest(request, response, handler) {
        test.find().exec(function(err, data) {
            jsonParse.sendResult(response, 200, data, '查询成功')
        })
    },
    async getDict(request, response, handler) {
        let params = await axios.grabPostParams(request)
        test.find({dictCode: params}).exec(function(err, data) {
            jsonParse.sendResult(response, 200, data, '查询成功')
        })
    },
}